package cxg.cloud.rulebean;

import com.netflix.loadbalancer.IRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义负载均衡的方法
 * @author Administrator
 */
@Configuration
public class MyRuleBean {

    @Bean
    public IRule myRule()
    {
        //return new RetryRule();
        //return new RoundRobinRule();
        //return new RandomRule();
        //自定义随机算法, 每个服务5次
        return new RandomRule_SF();
    }
}
